﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ERP.Manager.DataProvider;
using ERP.Manager.DataEntity;
namespace ERP.Manager.BusinessServices
{
    public class WorkBloginfoService
    {
        private readonly IWorkBlogRepository workBlogRepository;
        public WorkBloginfoService() { }

        public WorkBloginfoService(IWorkBlogRepository workblogrepository)
        {
            this.workBlogRepository = workblogrepository;
        }


        public int addWorkBlog(WorkBloginfo workblog)
        {

            return workBlogRepository.addWorkBlog(workblog);
        }

        public List<WorkBloginfo> getWorkBlogByUserid(string userId,int pagecount)
        {

            return workBlogRepository.getWorkBlogByUserid(userId,pagecount);
        }
        /// <summary>
        /// 根据工作记录编号查询工作的详细信息
        /// </summary>
        /// <param name="workblogid"></param>
        /// <returns></returns>
        public WorkBloginfo getWorkBlogById(int workblogid)
        {
            return workBlogRepository.getWorkBlogById(workblogid);
        }

        public int DeleteWorkBlog(int workblogId)
        {
            return workBlogRepository.DeleteWorkBlog(workblogId);
        }
        /// <summary>
        /// 根据当前用户编号查询所有的工作记录的总数
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public int getallworkblogcountbyuserid(string userid)
        {
            return workBlogRepository.getallworkblogcountbyuserid(userid);
        }

        public int UpdateWorkBlog(WorkBloginfo workblog)
        {
            return workBlogRepository.UpdateWorkBlog(workblog);
        }

    }
}
